package com.wooophone.file.util;

import java.io.FileWriter;
import java.io.IOException;
import java.util.Map;

import org.yaml.snakeyaml.Yaml;

public class Util {

	public static void main(String[] args) {

		String str = new String("\u4e2d\u56fd");
	    System.out.println(str);

	}

	public static synchronized void write(String url, Map<String, String> map) {
		try {

			FileWriter writer = null;
			try {
				writer = new FileWriter(url, true);
				writer.append(new Yaml().dump(map));
			} catch (IOException e) {
				e.printStackTrace();
			} finally {
				if (writer != null) {
					try {
						writer.flush();
						writer.close();
					} catch (IOException e) {
						e.printStackTrace();
					}
				}
			}

		} catch (Exception e) {
			e.printStackTrace();
		}
	}

}
